package com.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 文章与频道一对多关系
 */
@Entity
@Data
@Table( uniqueConstraints = @UniqueConstraint(columnNames = {"articalId", "channelId"}))
public class ArticalChannel implements Serializable {
    private static final long serialVersionUID = 1L;


    @Id
    @ApiModelProperty("主键")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 频道id
     */
    @ApiModelProperty("频道id")
    @Column(columnDefinition = "bigint")
    private Long channelId;
    @ApiModelProperty("创建时间")
    @Column(columnDefinition = "datetime")
    private Date crDate;
    @ApiModelProperty("文章id")
    @Column(columnDefinition = "bigint")
    private Long articalId;
}
